        <link href="<?php echo base_url(); ?>css/ionicons.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>css/iCheck/minimal/blue.css" rel="stylesheet" type="text/css" />


		<div  class="col-xs-12">

                            <div class="box box-solid">
                                <div class="box-body">

			<div class="row pad">
				<div class="col-sm-6">
					<!-- Action button -->
					<div class="btn-group">
						<button type="button" class="btn btn-default btn-sm btn-flat dropdown-toggle" data-toggle="dropdown">
							Action <span class="caret"></span>
						</button>
						<ul class="dropdown-menu" role="menu">
							<li><a href="#">Mark as read</a></li>
							<li><a href="#">Mark as unread</a></li>
							<li class="divider"></li>
							<li><a href="#">Move to junk</a></li>
							<li class="divider"></li>
							<li><a href="#">Delete</a></li>
						</ul>
					</div>

				</div>
				<div class="col-sm-6 search-form">
					<form action="#" class="text-right">
						<div class="input-group">                                                            
							<input type="text" class="form-control input-sm" placeholder="Search">
							<div class="input-group-btn">
								<button type="submit" name="q" class="btn btn-sm btn-primary"><i class="fa fa-search"></i></button>
							</div>
						</div>                                                     
					</form>
				</div>
			</div><!-- /.row -->

			<div class="table-responsive">
				<!-- THE MESSAGES -->
				<table class="table table-mailbox">

					<?php
					function waktu($waktu){
						$a=explode(' ',$waktu);
						$hasil=array('tanggal'=>$a[0],'jam'=>$a[1]);
						return $hasil;
					}
					
					function rev_date($tanggal){
						$a=explode('-',$tanggal);
						$hasil=$a[2].'-'.$a[1].'-'.$a[0];
						return $hasil;
					}

					$inbox=$this->mod_memo->inbox();
					foreach($inbox as $key=>$val){
						if($val->dibaca=='0'){
							$warna='#eeeeee';
							$b ='<b>';
							$bb='<b>';
						}else{
							$warna='#ffffff';						
							$b ='';
							$bb='';
						}
						$waktu=waktu($val->waktu);
						$tanggal=rev_date($waktu['tanggal']);
						$jam=$waktu['jam'];
					?>
						
						<tr class="unread" bgcolor="<?php echo $warna?>">
							<td class="small-col" width="1%"><input type="checkbox" /></td>
							<td class="name"><a href="#" onclick="tampil(<?php echo $val->idmemo?>)"><?php echo $b.$val->nama_lengkap.$bb;?></a></td>
							<td class="subject"><a href="#" onclick="tampil(<?php echo $val->idmemo?>)"><?php echo $b.$val->judul.$bb;?></a></td>
							<td class="time" align="right" width='5%'><?php echo $b.$tanggal.$bb;?></td>
							<td class="time" align="right" width='5%'><?php echo $b.$jam.$bb;?></td>
						</tr>
										
					<?php					
					}					
					?>	
				</table>
			</div><!-- /.table-responsive -->
			</div>


		<div class="box-footer clearfix">
			<div class="pull-right">
				<small>Showing 1-10/1,240</small>
				<button class="btn btn-xs btn-primary"><i class="fa fa-caret-left"></i></button>
				<button class="btn btn-xs btn-primary"><i class="fa fa-caret-right"></i></button>
			</div>
		</div><!-- box-footer -->

		</div>
		</div><!-- /.col (RIGHT) -->



	<!-- POPUP --------------------------->
	<a class="initialism fade_open btn btn-success" href="#fade" id="klik" style="display:none">Fade</a>
	<div id="fade" class="well">
		<div class="box">
			<div class="box-body table-responsive">
					<div id="isi" name="isi" style="width:900px;height:500px">test
					</div>
			</div><!-- /.box-body -->
		</div><!-- /.box -->
		<button class="fade_close btn btn-default" id="tutup" onclick="location.reload()">Close</button>
	</div>
	<!------------------------------------>

	<!-- jQuery 2.0.2 -->
	<script src="<?php echo base_url(); ?>js/jquery.min.js"></script>
	<script type="text/javascript">

		$(document).ready(function() {
			$('#fade').popup({
			  transition: 'all 0.5s',
			  scrolllock: true
			});
		});

		function tampil(cidmemo){

			$(document).ready(function(){
				$.ajax({
					type: "POST",
					url: '<?php echo base_url(); ?>/index.php/memo/isimemo',
					data: ({idmemo:cidmemo}),
					dataType:"json",
					success:function(data){						
						$('#isi').html(data.isi);
						document.getElementById('klik').click();
					}
				});
			});

		}
	</script>
